import { Component, OnInit } from '@angular/core';
import { LoadingController } from '@ionic/angular';

@Component({
  selector: 'app-testloading',
  templateUrl: './testloading.page.html',
  styleUrls: ['./testloading.page.scss'],
})
export class TestloadingPage implements OnInit {

  constructor(public loadingController: LoadingController) {}

  ngOnInit() {
  }
  showload(){
  this.presentLoading();
  }

  async presentLoading() {
    const loading = await this.loadingController.create({
      message: 'Hellooo',
      duration: 2000
    });
    await loading.present();

    const { role, data } = await loading.onDidDismiss();

    console.log('Loading dismissed!');
  }
  showload1(){
    this.presentLoadingWithOptions();
    }
  async presentLoadingWithOptions() {
    const loading = await this.loadingController.create({
      spinner: null,
      duration: 5000,
      message: 'Please wait...',
      translucent: true,
      cssClass: 'custom-class custom-loading'
    });
    return await loading.present();
  }
  
}
